// constSpringFunctionReader.cpp: implementation of the ConstSpringFunctionReader class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "constSpringFunctionReader.h"
#include "functionObject.h"
#include "ConstSpringFunction.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////


IMPLEMENT_DYNAMIC_CREATE(ConstSpringFunctionReader, PartDBReader, FunctionObject::eSELCONSTSPRING)

ConstSpringFunctionReader::ConstSpringFunctionReader()
{

}

ConstSpringFunctionReader::~ConstSpringFunctionReader()
{

}

FunctionObject* ConstSpringFunctionReader::Reader(const _RecordsetPtr& rs)
{
	FunctionObject* pObject = PartDBReader::CreateObject(rs);
	ASSERT(pObject);
	
	Variable* pVariable = NULL;

	ASSERT(pObject->GetRuntimeClass() == RUNTIME_CLASS_EX(ConstSpringFunction));

	ConstSpringFunction* pSpring = static_cast<ConstSpringFunction*>(pObject);
	
	pVariable = this->GetVariable(1, rs);
	ASSERT(pVariable);
	pSpring->ConstSpringDH(pVariable);


	pVariable = this->GetVariable(2, rs);
	ASSERT(pVariable);
	pSpring->MinDis(pVariable);

	pVariable = this->GetVariable(3, rs);
	ASSERT(pVariable);
	pSpring->MaxDis(pVariable);

	return pSpring;
}